#include <QtGui/QApplication>
#include <QtDebug>

#include "qmlapplicationviewer.h"
#include "customnetworkmanagerfactory.h"

#include <QDir>

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;

    CustomNetworkManagerFactory* myNetworkAccessManagerFactory = new CustomNetworkManagerFactory(app.data());
    viewer.engine()->setNetworkAccessManagerFactory(myNetworkAccessManagerFactory);
    viewer.engine()->addImportPath(":/");

    viewer.addImportPath("qml");
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/xrel/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
